import { createRouter, createWebHistory } from "vue-router";
import SystemHome from "@/pages/SystemHome.vue";
import UserLogin from "@/pages/UserLogin.vue";
import UserManage from '@/pages/UserManage.vue';
import PermissionManage from '@/pages/PermissionManage.vue';
import DivisionManage from '@/pages/DivisionManage.vue';
import MedicalManage from '@/pages/MedicalManage.vue';
import PolicyManage from '@/pages/PolicyManage.vue';
import InsuredManage from '@/pages/InsuredManage.vue';
import MedicalCardManage from '@/pages/MedicalCardManage.vue';
import PaymentManage from '@/pages/PaymentManage.vue';
import ApplyInfoManage from '@/pages/ApplyInfoManage.vue';
import AuditManage from '@/pages/AuditManage.vue';
import RemitManage from '@/pages/RemitManage.vue';
import DiseaseStatistics from '@/pages/DiseaseStatistics.vue';
import DivisionStatistics from '@/pages/DivisionStatistics.vue';

//定义路由序列
const routers = [
    {
        path: '/',
        name:'UserLogin',
        component: UserLogin,
        meta: { title: '用户登录' }
    },
    {
        path: '/SystemHome',
        name:'SystemHome',
        component: SystemHome,
        meta: { title: '系统首页' },
        redirect: '/SystemHome/UserManage', // 默认重定向到用户管理
        children:[
            {
                path:'/SystemHome/UserManage',
                name:'UserManage',
                component:UserManage,
                meta: { title: '用户管理', icon: 'User' }
            },
            {
                path: '/SystemHome/PermissionManage',
                name: 'PermissionManage',
                component: PermissionManage,
                meta: { title: '权限管理', icon: 'Lock' }
            },
            {
                path: '/SystemHome/DivisionManage',
                name: 'DivisionManage',
                component: DivisionManage,
                meta: { title: '行政区域管理', icon: 'MapLocation' }
            },
            {
                path: '/SystemHome/MedicalManage',
                name: 'MedicalManage',
                component: MedicalManage,
                meta: { title: '慢病信息管理', icon: 'Notebook' }
            },
            {
                path: '/SystemHome/PolicyManage',
                name: 'PolicyManage',
                component: PolicyManage,
                meta: { title: '慢病政策管理', icon: 'Document' }
            },

            // 业务管理
            {
                path: '/SystemHome/InsuredManage',
                name: 'InsuredManage',
                component: InsuredManage,
                meta: { title: '参合信息录入', icon: 'Edit' }
            },
            {
                path: '/SystemHome/MedicalCardManage',
                name: 'MedicalCardManage',
                component: MedicalCardManage,
                meta: { title: '慢性病证管理', icon: 'Postcard' }
            },
            {
                path: '/SystemHome/PaymentManage',
                name: 'PaymentManage',
                component: PaymentManage,
                meta: { title: '参合缴费登记', icon: 'Money' }
            },
            {
                path: '/SystemHome/ApplyInfoManage',
                name: 'ApplyInfoManage',
                component: ApplyInfoManage,
                meta: { title: '报销申请', icon: 'DocumentAdd' }
            },
            {
                path: '/SystemHome/AuditManage',
                name: 'AuditManage',
                component: AuditManage,
                meta: { title: '报销审核', icon: 'Finished' }
            },
            {
                path: '/SystemHome/RemitManage',
                name: 'RemitManage',
                component: RemitManage,
                meta: { title: '报销汇款', icon: 'Transfer' }
            },

            // 统计分析
            {
                path: '/SystemHome/DiseaseStatistics',
                name: 'DiseaseStatistics',
                component: DiseaseStatistics,
                meta: { title: '按病种统计', icon: 'DataLine' }
            },
            {
                path: '/SystemHome/DivisionStatistics',
                name: 'DivisionStatistics',
                component: DivisionStatistics,
                meta: { title: '按行政区域统计', icon: 'PieChart' }
            }
        ]
    },
    //路由规则
];

//创建路由器示例
const router = createRouter({
    history: createWebHistory(),
    routes:routers,
    });

export default router;